home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / complib / dtrsen.z / dtrsen
Text File  |  1998-10-30  |  10KB  |  265 lines

  1.  
  2.  
  3.  
  4. DDDDTTTTRRRRSSSSEEEENNNN((((3333FFFF))))                                                          DDDDTTTTRRRRSSSSEEEENNNN((((3333FFFF))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      DTRSEN - reorder the real Schur factorization of a real matrix A =
  10.      Q*T*Q**T, so that a selected cluster of eigenvalues appears in the
  11.      leading diagonal blocks of the upper quasi-triangular matrix T,
  12.  
  13. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  14.      SUBROUTINE DTRSEN( JOB, COMPQ, SELECT, N, T, LDT, Q, LDQ, WR, WI, M, S,
  15.                         SEP, WORK, LWORK, IWORK, LIWORK, INFO )
  16.  
  17.          CHARACTER      COMPQ, JOB
  18.  
  19.          INTEGER        INFO, LDQ, LDT, LIWORK, LWORK, M, N
  20.  
  21.          DOUBLE         PRECISION S, SEP
  22.  
  23.          LOGICAL        SELECT( * )
  24.  
  25.          INTEGER        IWORK( * )
  26.  
  27.          DOUBLE         PRECISION Q( LDQ, * ), T( LDT, * ), WI( * ), WORK( *
  28.                         ), WR( * )
  29.  
  30. PPPPUUUURRRRPPPPOOOOSSSSEEEE
  31.      DTRSEN reorders the real Schur factorization of a real matrix A =
  32.      Q*T*Q**T, so that a selected cluster of eigenvalues appears in the
  33.      leading diagonal blocks of the upper quasi-triangular matrix T, and the
  34.      leading columns of Q form an orthonormal basis of the corresponding right
  35.      invariant subspace.
  36.  
  37.      Optionally the routine computes the reciprocal condition numbers of the
  38.      cluster of eigenvalues and/or the invariant subspace.
  39.  
  40.      T must be in Schur canonical form (as returned by DHSEQR), that is, block
  41.      upper triangular with 1-by-1 and 2-by-2 diagonal blocks; each 2-by-2
  42.      diagonal block has its diagonal elemnts equal and its off-diagonal
  43.      elements of opposite sign.
  44.  
  45.  
  46. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  47.      JOB     (input) CHARACTER*1
  48.              Specifies whether condition numbers are required for the cluster
  49.              of eigenvalues (S) or the invariant subspace (SEP):
  50.              = 'N': none;
  51.              = 'E': for eigenvalues only (S);
  52.              = 'V': for invariant subspace only (SEP);
  53.              = 'B': for both eigenvalues and invariant subspace (S and SEP).
  54.  
  55.      COMPQ   (input) CHARACTER*1
  56.              = 'V': update the matrix Q of Schur vectors;
  57.              = 'N': do not update Q.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. DDDDTTTTRRRRSSSSEEEENNNN((((3333FFFF))))                                                          DDDDTTTTRRRRSSSSEEEENNNN((((3333FFFF))))
  71.  
  72.  
  73.  
  74.      SELECT  (input) LOGICAL array, dimension (N)
  75.              SELECT specifies the eigenvalues in the selected cluster. To
  76.              select a real eigenvalue w(j), SELECT(j) must be set to w(j) and
  77.              w(j+1), corresponding to a 2-by-2 diagonal block, either
  78.              SELECT(j) or SELECT(j+1) or both must be set to either both
  79.              included in the cluster or both excluded.
  80.  
  81.      N       (input) INTEGER
  82.              The order of the matrix T. N >= 0.
  83.  
  84.      T       (input/output) DOUBLE PRECISION array, dimension (LDT,N)
  85.              On entry, the upper quasi-triangular matrix T, in Schur canonical
  86.              form.  On exit, T is overwritten by the reordered matrix T, again
  87.              in Schur canonical form, with the selected eigenvalues in the
  88.              leading diagonal blocks.
  89.  
  90.      LDT     (input) INTEGER
  91.              The leading dimension of the array T. LDT >= max(1,N).
  92.  
  93.      Q       (input/output) DOUBLE PRECISION array, dimension (LDQ,N)
  94.              On entry, if COMPQ = 'V', the matrix Q of Schur vectors.  On
  95.              exit, if COMPQ = 'V', Q has been postmultiplied by the orthogonal
  96.              transformation matrix which reorders T; the leading M columns of
  97.              Q form an orthonormal basis for the specified invariant subspace.
  98.              If COMPQ = 'N', Q is not referenced.
  99.  
  100.      LDQ     (input) INTEGER
  101.              The leading dimension of the array Q.  LDQ >= 1; and if COMPQ =
  102.              'V', LDQ >= N.
  103.  
  104.      WR      (output) DOUBLE PRECISION array, dimension (N)
  105.              WI      (output) DOUBLE PRECISION array, dimension (N) The real
  106.              and imaginary parts, respectively, of the reordered eigenvalues
  107.              of T. The eigenvalues are stored in the same order as on the
  108.              diagonal of T, with WR(i) = T(i,i) and, if T(i:i+1,i:i+1) is a
  109.              2-by-2 diagonal block, WI(i) > 0 and WI(i+1) = -WI(i). Note that
  110.              if a complex eigenvalue is sufficiently ill-conditioned, then its
  111.              value may differ significantly from its value before reordering.
  112.  
  113.      M       (output) INTEGER
  114.              The dimension of the specified invariant subspace.  0 < = M <= N.
  115.  
  116.      S       (output) DOUBLE PRECISION
  117.              If JOB = 'E' or 'B', S is a lower bound on the reciprocal
  118.              condition number for the selected cluster of eigenvalues.  S
  119.              cannot underestimate the true reciprocal condition number by more
  120.              than a factor of sqrt(N). If M = 0 or N, S = 1.  If JOB = 'N' or
  121.              'V', S is not referenced.
  122.  
  123.      SEP     (output) DOUBLE PRECISION
  124.              If JOB = 'V' or 'B', SEP is the estimated reciprocal condition
  125.              number of the specified invariant subspace. If M = 0 or N, SEP =
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. DDDDTTTTRRRRSSSSEEEENNNN((((3333FFFF))))                                                          DDDDTTTTRRRRSSSSEEEENNNN((((3333FFFF))))
  137.  
  138.  
  139.  
  140.              norm(T).  If JOB = 'N' or 'E', SEP is not referenced.
  141.  
  142.      WORK    (workspace) DOUBLE PRECISION array, dimension (LWORK)
  143.  
  144.      LWORK   (input) INTEGER
  145.              The dimension of the array WORK.  If JOB = 'N', LWORK >=
  146.              max(1,N); if JOB = 'E', LWORK >= M*(N-M); if JOB = 'V' or 'B',
  147.              LWORK >= 2*M*(N-M).
  148.  
  149.      IWORK   (workspace) INTEGER array, dimension (LIWORK)
  150.              IF JOB = 'N' or 'E', IWORK is not referenced.
  151.  
  152.      LIWORK  (input) INTEGER
  153.              The dimension of the array IWORK.  If JOB = 'N' or 'E', LIWORK >=
  154.              1; if JOB = 'V' or 'B', LIWORK >= M*(N-M).
  155.  
  156.      INFO    (output) INTEGER
  157.              = 0: successful exit
  158.              < 0: if INFO = -i, the i-th argument had an illegal value
  159.              = 1: reordering of T failed because some eigenvalues are too
  160.              close to separate (the problem is very ill-conditioned); T may
  161.              have been partially reordered, and WR and WI contain the
  162.              eigenvalues in the same order as in T; S and SEP (if requested)
  163.              are set to zero.
  164.  
  165. FFFFUUUURRRRTTTTHHHHEEEERRRR DDDDEEEETTTTAAAAIIIILLLLSSSS
  166.      DTRSEN first collects the selected eigenvalues by computing an orthogonal
  167.      transformation Z to move them to the top left corner of T.  In other
  168.      words, the selected eigenvalues are the eigenvalues of T11 in:
  169.  
  170.                    Z'*T*Z = ( T11 T12 ) n1
  171.                             (  0  T22 ) n2
  172.                                n1  n2
  173.  
  174.      where N = n1+n2 and Z' means the transpose of Z. The first n1 columns of
  175.      Z span the specified invariant subspace of T.
  176.  
  177.      If T has been obtained from the real Schur factorization of a matrix A =
  178.      Q*T*Q', then the reordered real Schur factorization of A is given by A =
  179.      (Q*Z)*(Z'*T*Z)*(Q*Z)', and the first n1 columns of Q*Z span the
  180.      corresponding invariant subspace of A.
  181.  
  182.      The reciprocal condition number of the average of the eigenvalues of T11
  183.      may be returned in S. S lies between 0 (very badly conditioned) and 1
  184.      (very well conditioned). It is computed as follows. First we compute R so
  185.      that
  186.  
  187.                             P = ( I  R ) n1
  188.                                 ( 0  0 ) n2
  189.                                   n1 n2
  190.  
  191.      is the projector on the invariant subspace associated with T11.  R is the
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. DDDDTTTTRRRRSSSSEEEENNNN((((3333FFFF))))                                                          DDDDTTTTRRRRSSSSEEEENNNN((((3333FFFF))))
  203.  
  204.  
  205.  
  206.      solution of the Sylvester equation:
  207.  
  208.                            T11*R - R*T22 = T12.
  209.  
  210.      Let F-norm(M) denote the Frobenius-norm of M and 2-norm(M) denote the
  211.      two-norm of M. Then S is computed as the lower bound
  212.  
  213.                          (1 + F-norm(R)**2)**(-1/2)
  214.  
  215.      on the reciprocal of 2-norm(P), the true reciprocal condition number.  S
  216.      cannot underestimate 1 / 2-norm(P) by more than a factor of sqrt(N).
  217.  
  218.      An approximate error bound for the computed average of the eigenvalues of
  219.      T11 is
  220.  
  221.                             EPS * norm(T) / S
  222.  
  223.      where EPS is the machine precision.
  224.  
  225.      The reciprocal condition number of the right invariant subspace spanned
  226.      by the first n1 columns of Z (or of Q*Z) is returned in SEP.  SEP is
  227.      defined as the separation of T11 and T22:
  228.  
  229.                         sep( T11, T22 ) = sigma-min( C )
  230.  
  231.      where sigma-min(C) is the smallest singular value of the
  232.      n1*n2-by-n1*n2 matrix
  233.  
  234.         C  = kprod( I(n2), T11 ) - kprod( transpose(T22), I(n1) )
  235.  
  236.      I(m) is an m by m identity matrix, and kprod denotes the Kronecker
  237.      product. We estimate sigma-min(C) by the reciprocal of an estimate of the
  238.      1-norm of inverse(C). The true reciprocal 1-norm of inverse(C) cannot
  239.      differ from sigma-min(C) by more than a factor of sqrt(n1*n2).
  240.  
  241.      When SEP is small, small changes in T can cause large changes in the
  242.      invariant subspace. An approximate bound on the maximum angular error in
  243.      the computed right invariant subspace is
  244.  
  245.                          EPS * norm(T) / SEP
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.